package com.itcast.java.admin.controller;

import com.itcast.java.common.base.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.UUID;

/**
 * 写点什么？
 *
 * @author hrz
 * @since 2021/8/14 0014
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @PostMapping("/login")
    public R<?> login(String req) {
        System.out.println(req);
        HashMap<String, Object> map = new HashMap<>();
        map.put("token", UUID.randomUUID().toString().replaceAll("-", ""));
        return R.ok(map);
    }

    @GetMapping("/info")
    public R<?> info(String req) {
        System.out.println(req);
        HashMap<String, Object> map = new HashMap<>();
        map.put("avatar", "https://st-gdx.dancf.com/gaodingx/0/uxms/design/20210602-151306-021e.png?x-oss-process=image/resize,w_932/interlace,1,image/format,jpg");
        map.put("name", "小白骑驴问道");
        return R.ok(map);
    }

}
